from django.contrib import admin

from .models import UserProfile, UserPrivilege


@admin.register(UserPrivilege)
class UserPrivilegeAdmin(admin.ModelAdmin):
	""" 管理用户权限 """
	list_display = ['username', 'department', 'server', 'host_ip', 'host_user', 'host_uid', 'host_gid', 'create_time']


# class UserPrivilegeInline(admin.TabularInline):
# 	""" 管理用户权限 """
# 	model = UserPrivilege
# 	extra = 1
# 	list_display = ['username', 'department', 'server', 'host_ip', 'host_user', 'host_uid', 'host_gid', 'create_time']


@admin.register(UserProfile)
class UserProfileAdmin(admin.ModelAdmin):
	"""  用户信息后台管理 """
	list_display = ['uuid', 'username', 'department', 'phone', 'email']
	list_filter = ['username']

	# inlines = [UserPrivilegeInline]
